<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"94267840T004906","x":-55.900002,"y":-70.250000,"z":-556.000000,"width":120.000000,"height":86.500000,"length":80.000000,"weight":80.599998,"platform":"platform11","order":1,"material":"","type":1,"place":100},{"boxId":"942677801023265","x":-67.400002,"y":23.000000,"z":-562.500000,"width":97.000000,"height":100.000000,"length":67.000000,"weight":106.800003,"platform":"platform11","order":2,"material":"","type":1,"place":100},{"boxId":"94267840T004979","x":-76.650002,"y":92.250000,"z":-575.750000,"width":78.500000,"height":38.500000,"length":40.500000,"weight":20.200001,"platform":"platform11","order":3,"material":"","type":1,"place":100},{"boxId":"94267780101Z633","x":55.750000,"y":-10.250000,"z":-553.450012,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":4,"material":"","type":1,"place":100},{"boxId":"94267780101Z625","x":-64.250000,"y":-10.250000,"z":-473.450012,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":5,"material":"","type":1,"place":100},{"boxId":"94267780101Z623","x":39.049999,"y":-10.250000,"z":-468.350006,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":6,"material":"","type":1,"place":100},{"boxId":"94267780101Z631","x":-64.250000,"y":-10.250000,"z":-388.350006,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":7,"material":"","type":1,"place":100},{"boxId":"94267780101Z627","x":39.049999,"y":-10.250000,"z":-383.250000,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":8,"material":"","type":1,"place":100},{"boxId":"94267780101Z635","x":-64.250000,"y":-10.250000,"z":-303.250000,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":9,"material":"","type":1,"place":100},{"boxId":"94267780101Z629","x":39.049999,"y":-10.250000,"z":-298.149994,"width":103.300003,"height":206.500000,"length":85.099998,"weight":158.500000,"platform":"platform11","order":10,"material":"","type":1,"place":100},{"boxId":"942677801023264","x":-67.400002,"y":-85.000000,"z":-227.199997,"width":97.000000,"height":57.000000,"length":67.000000,"weight":57.000000,"platform":"platform11","order":11,"material":"","type":1,"place":100},{"boxId":"94267780101X493","x":31.100000,"y":-31.500000,"z":-226.350006,"width":100.000000,"height":164.000000,"length":58.500000,"weight":190.500000,"platform":"platform08","order":12,"material":"","type":1,"place":100},{"boxId":"942677801020780","x":10.600000,"y":62.000000,"z":-236.100006,"width":59.000000,"height":23.000000,"length":39.000000,"weight":8.400000,"platform":"platform08","order":13,"material":"","type":1,"place":100},{"boxId":"942677801020781","x":10.600000,"y":85.000000,"z":-236.100006,"width":59.000000,"height":23.000000,"length":39.000000,"weight":8.550000,"platform":"platform08","order":14,"material":"","type":1,"place":100},{"boxId":"94267780101Y182","x":10.350000,"y":104.750000,"z":-236.100006,"width":58.500000,"height":16.500000,"length":39.000000,"weight":8.000000,"platform":"platform08","order":15,"material":"","type":1,"place":100},{"boxId":"94267780101X504","x":31.100000,"y":-31.500000,"z":-167.850006,"width":100.000000,"height":164.000000,"length":58.500000,"weight":189.500000,"platform":"platform08","order":16,"material":"","type":1,"place":100},{"boxId":"94267780101Y180","x":10.350000,"y":58.750000,"z":-177.600006,"width":58.500000,"height":16.500000,"length":39.000000,"weight":7.950000,"platform":"platform08","order":17,"material":"","type":1,"place":100},{"boxId":"94267780101Y178","x":10.350000,"y":75.250000,"z":-177.600006,"width":58.500000,"height":16.500000,"length":39.000000,"weight":7.950000,"platform":"platform08","order":18,"material":"","type":1,"place":100},{"boxId":"94267780101Z895","x":10.350000,"y":91.750000,"z":-177.600006,"width":58.500000,"height":16.500000,"length":39.000000,"weight":8.100000,"platform":"platform08","order":19,"material":"","type":1,"place":100},{"boxId":"94267780101Y205","x":-1.650000,"y":104.750000,"z":-184.350006,"width":34.500000,"height":9.500000,"length":25.500000,"weight":1.180000,"platform":"platform08","order":20,"material":"","type":1,"place":100},{"boxId":"94267780101X492","x":-86.650002,"y":-31.500000,"z":-143.699997,"width":58.500000,"height":164.000000,"length":100.000000,"weight":190.500000,"platform":"platform08","order":21,"material":"","type":1,"place":100},{"boxId":"94267780101Z918","x":-96.400002,"y":58.750000,"z":-164.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":8.000000,"platform":"platform08","order":22,"material":"","type":1,"place":100},{"boxId":"94267780101Y176","x":-96.400002,"y":75.250000,"z":-164.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":8.000000,"platform":"platform08","order":23,"material":"","type":1,"place":100},{"boxId":"94267780101Y177","x":-96.400002,"y":91.750000,"z":-164.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":7.900000,"platform":"platform08","order":24,"material":"","type":1,"place":100},{"boxId":"94267780101Z630","x":-107.250000,"y":104.599998,"z":-182.800003,"width":17.299999,"height":9.200000,"length":21.799999,"weight":0.350000,"platform":"platform08","order":25,"material":"","type":1,"place":100},{"boxId":"94267780101X501","x":-7.400000,"y":-31.500000,"z":-109.349998,"width":100.000000,"height":164.000000,"length":58.500000,"weight":190.500000,"platform":"platform08","order":26,"material":"","type":1,"place":100},{"boxId":"94267780101Y179","x":-28.150000,"y":58.750000,"z":-119.099998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":7.950000,"platform":"platform08","order":27,"material":"","type":1,"place":100},{"boxId":"94267780101Y181","x":-28.150000,"y":75.250000,"z":-119.099998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":7.950000,"platform":"platform08","order":28,"material":"","type":1,"place":100},{"boxId":"94267780101Z894","x":-28.150000,"y":91.750000,"z":-119.099998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":8.000000,"platform":"platform08","order":29,"material":"","type":1,"place":100},{"boxId":"94267780101Z634","x":-46.500000,"y":104.599998,"z":-129.949997,"width":21.799999,"height":9.200000,"length":17.299999,"weight":0.350000,"platform":"platform08","order":30,"material":"","type":1,"place":100},{"boxId":"94267780101X505","x":-86.650002,"y":-31.500000,"z":-43.700001,"width":58.500000,"height":164.000000,"length":100.000000,"weight":190.500000,"platform":"platform08","order":31,"material":"","type":1,"place":100},{"boxId":"94267780101Y175","x":-96.400002,"y":58.750000,"z":-64.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":8.050000,"platform":"platform08","order":32,"material":"","type":1,"place":100},{"boxId":"94267780101Z919","x":-96.400002,"y":75.250000,"z":-64.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":7.950000,"platform":"platform08","order":33,"material":"","type":1,"place":100},{"boxId":"942677801020089","x":-96.400002,"y":91.750000,"z":-64.449997,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":34,"material":"","type":1,"place":100},{"boxId":"94267780101Z626","x":-107.250000,"y":104.599998,"z":-82.800003,"width":17.299999,"height":9.200000,"length":21.799999,"weight":0.350000,"platform":"platform08","order":35,"material":"","type":1,"place":100},{"boxId":"94267780101W176","x":71.849998,"y":-31.500000,"z":-88.599998,"width":58.500000,"height":164.000000,"length":100.000000,"weight":190.500000,"platform":"platform08","order":36,"material":"","type":1,"place":100},{"boxId":"94267780101Y203","x":62.099998,"y":58.750000,"z":-109.349998,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.500000,"platform":"platform08","order":37,"material":"","type":1,"place":100},{"boxId":"942677801020085","x":62.099998,"y":75.250000,"z":-109.349998,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":38,"material":"","type":1,"place":100},{"boxId":"942677801020088","x":62.099998,"y":91.750000,"z":-109.349998,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":39,"material":"","type":1,"place":100},{"boxId":"94267780101Z624","x":51.250000,"y":104.599998,"z":-127.699997,"width":17.299999,"height":9.200000,"length":21.799999,"weight":0.350000,"platform":"platform08","order":40,"material":"","type":1,"place":100},{"boxId":"94267780101X500","x":-7.400000,"y":-31.500000,"z":-50.849998,"width":100.000000,"height":164.000000,"length":58.500000,"weight":190.500000,"platform":"platform08","order":41,"material":"","type":1,"place":100},{"boxId":"94267780101Y204","x":-28.150000,"y":58.750000,"z":-60.599998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":6.500000,"platform":"platform08","order":42,"material":"","type":1,"place":100},{"boxId":"942677801020084","x":-28.150000,"y":75.250000,"z":-60.599998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":6.400000,"platform":"platform08","order":43,"material":"","type":1,"place":100},{"boxId":"94267780101Y199","x":-28.150000,"y":91.750000,"z":-60.599998,"width":58.500000,"height":16.500000,"length":39.000000,"weight":6.450000,"platform":"platform08","order":44,"material":"","type":1,"place":100},{"boxId":"94267780101Z632","x":-46.500000,"y":104.599998,"z":-71.449997,"width":21.799999,"height":9.200000,"length":17.299999,"weight":0.350000,"platform":"platform08","order":45,"material":"","type":1,"place":100},{"boxId":"94267780101X491","x":71.849998,"y":-31.500000,"z":11.400000,"width":58.500000,"height":164.000000,"length":100.000000,"weight":190.500000,"platform":"platform08","order":46,"material":"","type":1,"place":100},{"boxId":"94267780101Y200","x":62.099998,"y":58.750000,"z":-9.350000,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":47,"material":"","type":1,"place":100},{"boxId":"942677801020087","x":62.099998,"y":75.250000,"z":-9.350000,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":48,"material":"","type":1,"place":100},{"boxId":"942677801020086","x":62.099998,"y":91.750000,"z":-9.350000,"width":39.000000,"height":16.500000,"length":58.500000,"weight":6.450000,"platform":"platform08","order":49,"material":"","type":1,"place":100},{"boxId":"94267780101Z628","x":51.250000,"y":104.599998,"z":-27.700001,"width":17.299999,"height":9.200000,"length":21.799999,"weight":0.350000,"platform":"platform08","order":50,"material":"","type":1,"place":100},{"boxId":"94267780101X499","x":-7.400000,"y":-31.500000,"z":7.650000,"width":100.000000,"height":164.000000,"length":58.500000,"weight":189.500000,"platform":"platform08","order":51,"material":"","type":1,"place":100},{"boxId":"94267780101Z636","x":-46.500000,"y":55.099998,"z":-12.950000,"width":21.799999,"height":9.200000,"length":17.299999,"weight":0.350000,"platform":"platform08","order":52,"material":"","type":1,"place":100},{"boxId":"94267780101X494","x":-86.650002,"y":-31.500000,"z":56.299999,"width":58.500000,"height":164.000000,"length":100.000000,"weight":189.500000,"platform":"platform08","order":53,"material":"","type":1,"place":100},{"boxId":"942677801021503","x":-17.400000,"y":-75.750000,"z":96.900002,"width":80.000000,"height":75.500000,"length":120.000000,"weight":113.000000,"platform":"platform09","order":54,"material":"","type":1,"place":100},{"boxId":"942677801021502","x":-17.400000,"y":-0.250000,"z":96.900002,"width":80.000000,"height":75.500000,"length":120.000000,"weight":91.000000,"platform":"platform09","order":55,"material":"","type":1,"place":100},{"boxId":"942677801021504","x":-18.900000,"y":62.599998,"z":75.400002,"width":77.000000,"height":50.200001,"length":77.000000,"weight":47.500000,"platform":"platform09","order":56,"material":"","type":1,"place":100},{"boxId":"94267780101Z476","x":-28.900000,"y":96.449997,"z":69.400002,"width":57.000000,"height":17.500000,"length":65.000000,"weight":20.900000,"platform":"platform09","order":57,"material":"","type":1,"place":100},{"boxId":"942677801022668","x":62.049999,"y":-95.900002,"z":96.750000,"width":78.900002,"height":35.200001,"length":70.699997,"weight":13.880000,"platform":"platform09","order":58,"material":"","type":1,"place":100},{"boxId":"942677801022667","x":62.049999,"y":-60.700001,"z":96.750000,"width":78.900002,"height":35.200001,"length":70.699997,"weight":13.880000,"platform":"platform09","order":59,"material":"","type":1,"place":100},{"boxId":"94267780101Z466","x":62.250000,"y":-25.700001,"z":96.150002,"width":79.300003,"height":34.799999,"length":69.500000,"weight":12.840000,"platform":"platform09","order":60,"material":"","type":1,"place":100},{"boxId":"94267780101Z465","x":62.250000,"y":9.100000,"z":96.150002,"width":79.300003,"height":34.799999,"length":69.500000,"weight":12.840000,"platform":"platform09","order":61,"material":"","type":1,"place":100},{"boxId":"94267780101Z642","x":62.049999,"y":43.799999,"z":96.199997,"width":78.900002,"height":34.599998,"length":69.599998,"weight":12.800000,"platform":"platform09","order":62,"material":"","type":1,"place":100},{"boxId":"94267780101Z641","x":62.049999,"y":78.400002,"z":96.199997,"width":78.900002,"height":34.599998,"length":69.599998,"weight":12.800000,"platform":"platform09","order":63,"material":"","type":1,"place":100},{"boxId":"94267780101Z460","x":55.099998,"y":104.449997,"z":89.900002,"width":65.000000,"height":17.500000,"length":57.000000,"weight":20.799999,"platform":"platform09","order":64,"material":"","type":1,"place":100},{"boxId":"94267780101Z242","x":62.049999,"y":-96.949997,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":12.640000,"platform":"platform09","order":65,"material":"","type":1,"place":100},{"boxId":"94267780101Z478","x":62.049999,"y":-63.849998,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":66,"material":"","type":1,"place":100},{"boxId":"94267780101Z462","x":62.049999,"y":-30.750000,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":67,"material":"","type":1,"place":100},{"boxId":"94267780101Z461","x":62.049999,"y":2.350000,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":68,"material":"","type":1,"place":100},{"boxId":"94267780101Z477","x":62.049999,"y":35.450001,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":69,"material":"","type":1,"place":100},{"boxId":"94267780101Z241","x":62.049999,"y":68.550003,"z":166.850006,"width":78.900002,"height":33.099998,"length":69.500000,"weight":12.640000,"platform":"platform09","order":70,"material":"","type":1,"place":100},{"boxId":"94267780101Z783","x":55.099998,"y":93.849998,"z":160.600006,"width":65.000000,"height":17.500000,"length":57.000000,"weight":20.950001,"platform":"platform09","order":71,"material":"","type":1,"place":100},{"boxId":"94267780101X473","x":41.849998,"y":107.599998,"z":149.850006,"width":38.500000,"height":10.000000,"length":35.500000,"weight":2.780000,"platform":"platform09","order":72,"material":"","type":1,"place":100},{"boxId":"94267780101Z002","x":-76.449997,"y":-96.949997,"z":191.649994,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":73,"material":"","type":1,"place":100},{"boxId":"94267780101Z001","x":-76.449997,"y":-63.849998,"z":191.649994,"width":78.900002,"height":33.099998,"length":69.500000,"weight":13.160000,"platform":"platform09","order":74,"material":"","type":1,"place":100},{"boxId":"94267780101Z735","x":-83.400002,"y":-38.549999,"z":185.399994,"width":65.000000,"height":17.500000,"length":57.000000,"weight":20.900000,"platform":"platform09","order":75,"material":"","type":1,"place":100},{"boxId":"94267780101Z240","x":-86.400002,"y":-14.300000,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":20.500000,"platform":"platform09","order":76,"material":"","type":1,"place":100},{"boxId":"94267780101Z640","x":-86.400002,"y":16.700001,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":18.299999,"platform":"platform09","order":77,"material":"","type":1,"place":100},{"boxId":"94267780101Z790","x":-86.400002,"y":47.700001,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":20.850000,"platform":"platform09","order":78,"material":"","type":1,"place":100},{"boxId":"94267780101Z792","x":-86.400002,"y":78.699997,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":20.850000,"platform":"platform09","order":79,"material":"","type":1,"place":100},{"boxId":"94267780101X307","x":-97.150002,"y":102.949997,"z":175.149994,"width":37.500000,"height":17.500000,"length":36.500000,"weight":16.219999,"platform":"platform09","order":80,"material":"","type":1,"place":100},{"boxId":"94267780101Z000","x":-7.500000,"y":-98.000000,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":20.799999,"platform":"platform09","order":81,"material":"","type":1,"place":100},{"boxId":"94267780101Z787","x":-7.500000,"y":-67.000000,"z":176.399994,"width":59.000000,"height":31.000000,"length":39.000000,"weight":20.900000,"platform":"platform09","order":82,"material":"","type":1,"place":100},{"boxId":"94267780101W273","x":-10.750000,"y":-41.250000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.400000,"platform":"platform09","order":83,"material":"","type":1,"place":100},{"boxId":"94267780101W287","x":-10.750000,"y":-20.750000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":84,"material":"","type":1,"place":100},{"boxId":"94267780101W289","x":-10.750000,"y":-0.250000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":85,"material":"","type":1,"place":100},{"boxId":"94267780101W298","x":-10.750000,"y":20.250000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.350000,"platform":"platform09","order":86,"material":"","type":1,"place":100},{"boxId":"94267780101W295","x":-10.750000,"y":40.750000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":87,"material":"","type":1,"place":100},{"boxId":"94267780101W286","x":-10.750000,"y":61.250000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":88,"material":"","type":1,"place":100},{"boxId":"94267780101W276","x":-10.750000,"y":81.750000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":89,"material":"","type":1,"place":100},{"boxId":"94267780101W275","x":-10.750000,"y":102.250000,"z":178.149994,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":90,"material":"","type":1,"place":100},{"boxId":"94267780101W269","x":-89.650002,"y":-103.250000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":91,"material":"","type":1,"place":100},{"boxId":"94267780101W274","x":-89.650002,"y":-82.750000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.300000,"platform":"platform09","order":92,"material":"","type":1,"place":100},{"boxId":"94267780101Z464","x":-89.650002,"y":-62.250000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":14.900000,"platform":"platform09","order":93,"material":"","type":1,"place":100},{"boxId":"94267780101Z482","x":-89.650002,"y":-41.750000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":94,"material":"","type":1,"place":100},{"boxId":"94267780101Z475","x":-89.650002,"y":-21.250000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":95,"material":"","type":1,"place":100},{"boxId":"94267780101Y909","x":-89.650002,"y":-0.750000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":96,"material":"","type":1,"place":100},{"boxId":"94267780101Z479","x":-89.650002,"y":19.750000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":97,"material":"","type":1,"place":100},{"boxId":"94267780101Z455","x":-89.650002,"y":40.250000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":98,"material":"","type":1,"place":100},{"boxId":"94267780101Z467","x":-89.650002,"y":60.750000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":99,"material":"","type":1,"place":100},{"boxId":"94267780101Z483","x":-89.650002,"y":81.250000,"z":127.550003,"width":52.500000,"height":20.500000,"length":42.500000,"weight":4.800000,"platform":"platform09","order":100,"material":"","type":1,"place":100},{"boxId":"94267780101X482","x":-97.150002,"y":96.250000,"z":117.550003,"width":37.500000,"height":9.500000,"length":22.500000,"weight":0.940000,"platform":"platform09","order":101,"material":"","type":1,"place":100},{"boxId":"94267780101Z463","x":-18.250000,"y":-101.750000,"z":219.850006,"width":37.500000,"height":23.500000,"length":36.500000,"weight":6.550000,"platform":"platform09","order":102,"material":"","type":1,"place":100},{"boxId":"94267780101L421","x":40.500000,"y":-80.250000,"z":261.600006,"width":80.000000,"height":66.500000,"length":120.000000,"weight":49.599998,"platform":"platform04","order":103,"material":"","type":1,"place":100},{"boxId":"94267780101L417","x":40.500000,"y":-13.750000,"z":261.600006,"width":80.000000,"height":66.500000,"length":120.000000,"weight":50.400002,"platform":"platform04","order":104,"material":"","type":1,"place":100},{"boxId":"942677801023700","x":31.500000,"y":44.500000,"z":261.600006,"width":62.000000,"height":50.000000,"length":120.000000,"weight":78.000000,"platform":"platform04","order":105,"material":"","type":1,"place":100},{"boxId":"942677801023701","x":31.500000,"y":85.750000,"z":252.850006,"width":62.000000,"height":32.500000,"length":102.500000,"weight":27.520000,"platform":"platform04","order":106,"material":"","type":1,"place":100},{"boxId":"942677801023699","x":-84.900002,"y":-88.500000,"z":286.399994,"width":62.000000,"height":50.000000,"length":120.000000,"weight":78.000000,"platform":"platform04","order":107,"material":"","type":1,"place":100},{"boxId":"94267780101L420","x":-82.150002,"y":-45.250000,"z":271.149994,"width":67.500000,"height":36.500000,"length":89.500000,"weight":28.400000,"platform":"platform04","order":108,"material":"","type":1,"place":100},{"boxId":"94267780101L416","x":-82.150002,"y":-8.750000,"z":271.149994,"width":67.500000,"height":36.500000,"length":89.500000,"weight":28.400000,"platform":"platform04","order":109,"material":"","type":1,"place":100},{"boxId":"94267780101L415","x":-86.650002,"y":50.000000,"z":270.149994,"width":58.500000,"height":81.000000,"length":87.500000,"weight":100.000000,"platform":"platform04","order":110,"material":"","type":1,"place":100},{"boxId":"942677801020778","x":-87.400002,"y":99.250000,"z":258.899994,"width":57.000000,"height":17.500000,"length":65.000000,"weight":8.250000,"platform":"platform04","order":111,"material":"","type":1,"place":100},{"boxId":"94267780101L419","x":-4.650000,"y":-73.000000,"z":350.850006,"width":87.500000,"height":81.000000,"length":58.500000,"weight":100.000000,"platform":"platform04","order":112,"material":"","type":1,"place":100},{"boxId":"942677801020776","x":-8.400000,"y":9.250000,"z":351.600006,"width":80.000000,"height":83.500000,"length":60.000000,"weight":40.000000,"platform":"platform04","order":113,"material":"","type":1,"place":100},{"boxId":"942677801020787","x":-15.900000,"y":59.750000,"z":350.100006,"width":65.000000,"height":17.500000,"length":57.000000,"weight":8.200000,"platform":"platform04","order":114,"material":"","type":1,"place":100},{"boxId":"942677801020782","x":-17.150000,"y":87.000000,"z":350.100006,"width":62.500000,"height":37.000000,"length":57.000000,"weight":11.500000,"platform":"platform04","order":115,"material":"","type":1,"place":100},{"boxId":"942677801020789","x":-85.900002,"y":-71.750000,"z":386.399994,"width":60.000000,"height":83.500000,"length":80.000000,"weight":40.000000,"platform":"platform04","order":116,"material":"","type":1,"place":100},{"boxId":"942677801020777","x":-85.150002,"y":2.100000,"z":378.399994,"width":61.500000,"height":64.199997,"length":64.000000,"weight":32.000000,"platform":"platform04","order":117,"material":"","type":1,"place":100},{"boxId":"942677801020786","x":-85.150002,"y":66.300003,"z":378.399994,"width":61.500000,"height":64.199997,"length":64.000000,"weight":32.000000,"platform":"platform04","order":118,"material":"","type":1,"place":100},{"boxId":"94267780101L418","x":69.599998,"y":-91.900002,"z":343.850006,"width":61.000000,"height":43.200001,"length":44.500000,"weight":29.850000,"platform":"platform04","order":119,"material":"","type":1,"place":100},{"boxId":"94267780101L422","x":69.599998,"y":-48.700001,"z":343.850006,"width":61.000000,"height":43.200001,"length":44.500000,"weight":30.250000,"platform":"platform04","order":120,"material":"","type":1,"place":100},{"boxId":"942677801020788","x":63.849998,"y":-12.100000,"z":340.350006,"width":49.500000,"height":30.000000,"length":37.500000,"weight":2.700000,"platform":"platform04","order":121,"material":"","type":1,"place":100},{"boxId":"942677801020779","x":63.849998,"y":17.900000,"z":340.350006,"width":49.500000,"height":30.000000,"length":37.500000,"weight":2.650000,"platform":"platform04","order":122,"material":"","type":1,"place":100},{"boxId":"94267840T004963","x":-75.900002,"y":-80.250000,"z":486.399994,"width":80.000000,"height":66.500000,"length":120.000000,"weight":80.000000,"platform":"platform05","order":123,"material":"","type":1,"place":100},{"boxId":"94267840T004962","x":-85.900002,"y":-5.250000,"z":466.399994,"width":60.000000,"height":83.500000,"length":80.000000,"weight":48.500000,"platform":"platform05","order":124,"material":"","type":1,"place":100},{"boxId":"94267780101Y994","x":-91.900002,"y":45.000000,"z":450.399994,"width":48.000000,"height":17.000000,"length":48.000000,"weight":11.280000,"platform":"platform05","order":125,"material":"","type":1,"place":100},{"boxId":"94267780101Z059","x":-91.900002,"y":62.000000,"z":450.399994,"width":48.000000,"height":17.000000,"length":48.000000,"weight":16.299999,"platform":"platform05","order":126,"material":"","type":1,"place":100},{"boxId":"94267780101Z062","x":-91.900002,"y":79.000000,"z":450.399994,"width":48.000000,"height":17.000000,"length":48.000000,"weight":16.299999,"platform":"platform05","order":127,"material":"","type":1,"place":100},{"boxId":"94267780101Y999","x":-92.900002,"y":-98.300003,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":128,"material":"","type":1,"place":100},{"boxId":"94267780101Y998","x":-92.900002,"y":-67.900002,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":129,"material":"","type":1,"place":100},{"boxId":"94267780101Y997","x":-92.900002,"y":-37.500000,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":130,"material":"","type":1,"place":100},{"boxId":"94267780101Y996","x":-92.900002,"y":-7.100000,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":131,"material":"","type":1,"place":100},{"boxId":"94267780101Y995","x":-92.900002,"y":23.299999,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":132,"material":"","type":1,"place":100},{"boxId":"94267780101Z054","x":-92.900002,"y":53.700001,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":28.400000,"platform":"platform05","order":133,"material":"","type":1,"place":100},{"boxId":"94267780101Z053","x":-92.900002,"y":84.099998,"z":569.400024,"width":46.000000,"height":30.400000,"length":46.000000,"weight":23.379999,"platform":"platform05","order":134,"material":"","type":1,"place":100},{"boxId":"94267840T004983","x":19.100000,"y":-83.349998,"z":436.600006,"width":110.000000,"height":60.299999,"length":110.000000,"weight":111.000000,"platform":"platform16","order":135,"material":"","type":1,"place":100},{"boxId":"94267840T004984","x":-5.900000,"y":-11.450000,"z":421.600006,"width":60.000000,"height":83.500000,"length":80.000000,"weight":35.799999,"platform":"platform16","order":136,"material":"","type":1,"place":100},{"boxId":"94267840T004990","x":-16.400000,"y":43.799999,"z":411.100006,"width":39.000000,"height":27.000000,"length":59.000000,"weight":13.960000,"platform":"platform16","order":137,"material":"","type":1,"place":100},{"boxId":"94267840T004989","x":-17.150000,"y":74.800003,"z":400.350006,"width":37.500000,"height":35.000000,"length":37.500000,"weight":7.340000,"platform":"platform16","order":138,"material":"","type":1,"place":100}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":227.000000,"container_max_load":23000.000000,"container_type_name":"40GP"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>